	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:shiro="http://shiro.apache.org/tags">
	<style>
.cols {
	vertical-align: top;
}
</style>
	<h:form id="form">
		<h:panelGrid columns="2" columnClasses="cols,cols" width="200">
			<rich:panelMenu activeItem="#{panelMenuBean.currentGroup.id}">
				<c:forEach items="#{panelMenuBean.groups}" var="gr">
					<rich:panelMenuGroup label="#{gr.name}">
						<c:forEach items="#{gr.children}" var="d">
							<rich:panelMenuItem label="#{d.name}" action="#{d.id}"
								mode="client" name="#{d.id}"
								onclick="document.location.href='#{facesContext.externalContext.requestContextPath}/views/event-markets.jsf?eveT=#{gr.id}&amp;eve=#{d.id}'">
							</rich:panelMenuItem>
						</c:forEach>
						<shiro:hasRole name="administrador">
		                	<h:commandButton  disabled="#{false}"  image="/images/add-icon2.png" action="/views/add-event.jsf">
		                		<f:param name="eveT" value="#{gr.id}"/> 
		                	</h:commandButton>
		                </shiro:hasRole>
					</rich:panelMenuGroup>
				</c:forEach>
			</rich:panelMenu>			
		</h:panelGrid>
		<shiro:hasRole name="usuario">
			<h:panelGrid columnClasses="acent">
		   		 <rich:dataTable value="#{userAccountBean.compositeBetdescriptors}" var="bet"
	            id="table" rows="10">
	            <rich:column>
	                <f:facet name="header">
	                    <h:outputText value="Evento" />
	                </f:facet>
	                <h:outputText value="#{bet.eventTypeName}/#{bet.eventName}//#{bet.marketName}" />
	            </rich:column>
	            <rich:column>
	                <f:facet name="header">
	                    <h:outputText value="Apuesta" />
	                </f:facet>
	                <h:outputText value="#{bet.marketResultName}" />
	            </rich:column>
	        	</rich:dataTable>
	    	</h:panelGrid>
			<h:commandButton  disabled="#{!userAccountBean.compositeBetEnabled}"  value="Finalizar Apuesta combinada" action="/views/finish-composite-bet.jsf">
			</h:commandButton>
			<h:commandButton  disabled="#{!userAccountBean.compositeBetEnabled}"  value="Limpiar" action="#{betBean.cleanBet}">
        	</h:commandButton>
       </shiro:hasRole>
		
	</h:form>
</ui:composition>